/**
 * 
 */
package org.xlab.baseframework.test.webservice.client;

import java.util.Date;
import java.util.UUID;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.test.context.ContextConfiguration;
import org.xlab.baseframework.exception.SystemException;
import org.xlab.baseframework.test.base.BaseTester;
import org.xlab.baseframework.test.platform.domain.BizTransactionLog;
import org.xlab.baseframework.test.platform.domain.enumerate.SynchronizedInditify;
import org.xlab.baseframework.test.platform.webservice.api.ITransactionWebService;

/**
 * @author MaKuBEX
 * 
 */
@RunWith(BaseTester.class)
@ContextConfiguration("classpath:org/xlab/baseframework/conf/module/*/baseframework-*.xml")
public class TransWebServiceTestCase {

	@Autowired
	@Qualifier("bpf_transWebServiceClient")
	private ITransactionWebService transactionWebService;
	
	//	@Test
	public void generateTransData() {
		BizTransactionLog[] allRecord = new BizTransactionLog[9];
		for (int i = 0; i < 3; i++) {
			BizTransactionLog bizLog = new BizTransactionLog();
			bizLog.setCommandId("PA");
			bizLog.setCreatedBy("MAKUBEX");
			bizLog.setCreatedTime(new Date());
			bizLog.setLastUpdatedBy("MAKUBEX");
			bizLog.setLastUpdatedTime(new Date());
			bizLog.setDeviceId("10000");
			bizLog.setEpcNo("A00120000101000000000001");
			bizLog.setLocation("PL01");
			bizLog.setSynchronizedInd(SynchronizedInditify.N);
			bizLog.setToken(UUID.randomUUID().toString());
			bizLog.setLotNo("100191");
			bizLog.setQty(40);
			allRecord[i] = bizLog;
		}
		try {
			this.transactionWebService.upload(allRecord);
		} catch (SystemException e) {
			e.printStackTrace();
		}
	}

@Test
	public void run() {
		System.out.println("Skip testing");
	}
}
